local jintao = fk.CreateSkill {
    name = "cao__jintao",
    tags = { Skill.Switch },
}

Fk:loadTranslationTable {
    ["cao__jintao"] = "锦涛",
    [":cao__jintao"] = "<b>转换技</b>，阳：你造成伤害时，你可以交给目标两张牌并令此伤害+1；阴：你受到伤害时，你可以交给伤害来源两张牌并令此伤害-1。",
}

jintao:addEffect(fk.DamageCaused, {
    anim_type = "switch",
    can_trigger = function (self, event, target, player, data)
        return target == player and player:hasSkill(jintao.name) and player:getSwitchSkillState(jintao.name) == fk.SwitchYang
        and #player:getCardIds("he") >= 2
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        local cards = room:askToChooseCards(player, { target = player, flag = "he", skill_name = jintao.name, min = 2, max = 2 })
        room:moveCardTo(cards, Player.Hand, data.to, fk.ReasonGive, jintao.name, nil, false)
        data:changeDamage(1)
    end
})

jintao:addEffect(fk.DamageInflicted, {
    can_trigger = function (self, event, target, player, data)
        return target == player and player:hasSkill(jintao.name) and player:getSwitchSkillState(jintao.name) == fk.SwitchYin
        and #player:getCardIds("he") >= 2
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        local cards = room:askToChooseCards(player, { target = player, flag = "he", skill_name = jintao.name, min = 2, max = 2 })
        room:moveCardTo(cards, Player.Hand, data.from, fk.ReasonGive, jintao.name, nil, false)
        data:changeDamage(-1)
    end
})

return jintao